
#define _CRT_SECURE_NO_DEPRECATE

#include "sk_bitfieldsbase.h"
typedef struct Canon_s
{
	unsigned short	aut;
	unsigned short	box;
	byte	map[10];
	byte	row[9];
	byte	col[9];
} Canon_t;


class CAN_ON_PATTERN{

	struct FIRST_IN_BAND{
		word rc,        // row or column absolute index	
		     perm;		// perm number (0-1296)
	};

	struct BAND_STACK{
		word band;		// 0-5
		word perm;		// perm in use
	};

	struct TWO_BANDS{word b3,perm; 	};
	public:

	int 	max_band,max_2band,max_3band;

	word	max_store1, // max value found for store on pattern 
			n_store1,      // rows columns storage
			n_band,
			n_2band;	  // band+perm in band storage

	FIRST_IN_BAND t_fib[10000]; // all row column max lex equivalent 
	BAND_STACK   bs[20000];   // all band stack max lex perms
	TWO_BANDS bs2[4000]; // all max for 2 bands usually < 5


	int Canonical(word * pr_in,int check=0);  // pp is a 18 rows col words tables
	void Can_6rows(word * pr_in);
	int CheckBand3(word * pr_in);
	int CheckBands_2_3(word * pr_in);  // pp is a 18 rows col words tables
	int MinLexBand40(word * pr_in);// special minlex for band 1 magic40

};
